package com.epfresh.api.widget.lines;

import android.graphics.Point;
import android.graphics.PointF;

import java.text.DecimalFormat;

/**
 * @author wangzhanghuan
 * @version 1.0
 * @date create 17-5-8
 * @Description
 */

public class UnitPointF extends PointF{

    private int typePoint;
    private String extY;

    private int position;

    public UnitPointF() {

    }
    public UnitPointF(int typePoint) {
        this.typePoint = typePoint;
    }

    public UnitPointF(float x, float y, int typePoint) {
        super(x, y);
        this.typePoint = typePoint;
    }
    public UnitPointF(float x, float y, int typePoint, String extY) {
        super(x, y);
        this.typePoint = typePoint;
        this.extY = extY;
    }
    public UnitPointF(float x, float y) {
        super(x, y);
    }

    public UnitPointF(Point p, int typePoint) {
        super(p);
        this.typePoint = typePoint;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public int getTypePoint() {
        return typePoint;
    }

    public void setTypePoint(int typePoint) {
        this.typePoint = typePoint;
    }

    public String getExtY() {

        if(extY==null){
            return "0.00";
        }
        try {
            DecimalFormat decimalFormat = new DecimalFormat("###0.00");//格式化设置
            Double flag = Double.parseDouble(extY);
            extY = decimalFormat.format(flag);
        }catch (Exception e){
            return "0.00";
        }
        return extY;
    }

    public void setExtY(String extY) {
        this.extY = extY;
    }
}
